﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using User_Interface_Design.DAO;

namespace User_Interface_Design
{
    public partial class TraCuuDia : Form
    {
        public TraCuuDia()
        {
            InitializeComponent();
        }



        //private void button1_Click(object sender, EventArgs e)
        //{
        //    databaseDataContext CHvideo = new databaseDataContext();
        //    string ten = tb_ten.Text;
        //    string tl = cbb_theloai.SelectedItem.ToString();
        //    string dongia = tb_dongia.Text;
        //    DateTime ngay = DateTime.Parse(dateTimePicker1.Text);
        //    List<Phim> dsp = new DataAccess().LayDSPhim(int.Parse(tl));
        //    DTO.Phim kq = new DataAccess().LayTTPhim(dsp, ten, double.Parse(dongia), int.Parse(tl),ngay);
        //    // cho nao vay :D nhu cai bai kia thi may dong duoi la de gan vao datagridview ma sao no hok ra< trong ko ha

        //    if (kq != null)
        //    {
        //        dataGridView1.Rows.Clear();
        //        string[] temp = new string[] { kq.ten, kq.theloai.ToString(), kq.soluong.ToString(), kq.ngay.ToString(), kq.conlai.ToString() };
        //        dataGridView1.Rows.Add(temp);
        //    }
        //    //dataGridView1.AutoGenerateColumns = true;
        //    //dataGridView1.DataSource = kq;
        //    //TenDia.DataPropertyName = kq.ten;
        //    //LoaiPhim.DataPropertyName = kq.theloai.ToString();
        //    //SoLuong.DataPropertyName = kq.soluong.ToString();
        //    //NgayPhatHanh.DataPropertyName = kq.ngay.ToString();
        //    //DonGia.DataPropertyName = kq.dongia.ToString();
        //    //ConLai.DataPropertyName = kq.conlai.ToString();
        //    //dataGridView1.dât
        //    //
        //}

        //private void cbb_theloai_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    databaseDataContext CHvideo = new databaseDataContext();            
        //    string theloai = cbb_theloai.SelectedItem.ToString();
        //    double dg = (from lp in CHvideo.LoaiPhims where lp.MaLoaiPhim == int.Parse(theloai) select lp.DonGia.Value).First();
        //    tb_dongia.Text = dg.ToString();
        //}
        

        //private void TraCuuDia_Load(object sender, EventArgs e)
        //{
        //    databaseDataContext CHvideo = new databaseDataContext();

        //    cbb_theloai.ValueMember = "MaLoaiPhim";
        //    cbb_theloai.DisplayMember = "Thể loại";

        //    List<int> temp = (from lp in CHvideo.LoaiPhims select lp.MaLoaiPhim).ToList();

        //    cbb_theloai.DataSource = temp;
        //    string theloai = cbb_theloai.SelectedItem.ToString();
        //  //  double dg = (from lp in CHvideo.LoaiPhims where lp.MaLoaiPhim == int.Parse(theloai) select lp.DonGia).First();
        //    //tb_dongia.Text = dg.ToString();
        //}

        
    }
}
